#pragma once
#include <iostream>
#include "comm.hpp"
using namespace std;

class Client
{
public:
    Client()
        :_fd(gdefault)
    {}

    ~Client()
    {}

    bool OpenPipeForWrite()
    {
        _fd = OpenPipe(gwite);
        return _fd > 0 ? true : false;
    }

    bool ClosePipe()
    {
        return ClosePipeHeap(_fd);
    }

    int SendPipe(string &in)
    {
        return write(_fd, in.c_str(), in.size());
    }

private:
    int _fd;
};